package com.源码分析;

import reactor.core.publisher.Flux;

public class ReduceAndScan {

	public static void main(String[] args) {
		Flux.range(1, 5).reduce(0, (acc, elem) -> acc + elem).subscribe(System.out::println); // 打印最终叠加结果
		Flux.range(1, 5).scan(0, (acc, elem) -> acc + elem).subscribe(System.out::println); // 打印出中间过程和最终结果
	}

}
